﻿using System;
using System.Windows.Data;

namespace RomBotUI.Helpers
{
    //[ValueConversion( typeof( string ), typeof( int ) )]
    internal class StringToIntConverter : IValueConverter
    {
        public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
        {
            return Int32.Parse( value != null ? value.ToString() : "0" );
        }

        public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
        {
            return value != null ? value.ToString() : "-1";
        }
    }
}
